﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ErickOrlando.Utilidades.Data;
using FluentAssertions;

namespace GeneralesTest
{
    [TestClass]
    public class FechaHoraUnitTest
    {
        [TestMethod]
        public void FormatoDateTest()
        {
            var result = FechaHora.FormatoDate(new DateTime(2005, 2, 4));
            result.Should().Be(20050204);
        }

        [TestMethod]
        public void FormatoTimeTest()
        {
            var result = FechaHora.FormatoTime(new DateTime(2005, 11, 20, 17, 4, 0));
            result.Should().Be(170400);
        }

        [TestMethod]
        public void IntegerToDateTest()
        {
            var result = FechaHora.FormatoDate(20050204);
            result.Should().Be(new DateTime(2005, 2, 4));
        }

        [TestMethod]
        public void IntegerToTimeTest()
        {
            var result = FechaHora.FormatoTime(5);
            result.Should().Be("00:00:05");
        }
    }
}
